/**
 * 
 */
package co.fitstart.admin.service;

import java.util.List;
import com.demo2do.core.support.Page;
import co.fitstart.admin.entity.security.Login;
import co.fitstart.entity.course.Course;
import co.fitstart.entity.course.CourseType;
import co.fitstart.entity.course.CourseUnit;
import co.fitstart.entity.finance.InventoryExportRecord;
import co.fitstart.entity.product.Product;
import co.fitstart.entity.product.ProductType;

/**
 * @author downpour
 *
 */
public interface ProductService extends DataService<Product> {
    
    /**
     * 
     * @param export
     * @param page
     * @return
     */
    public List<Product> list(boolean export, Page page);
    
    /**
     * 
     * @param type
     * @param page
     * @return
     */
    public List<Product> list(ProductType type, Page page);
    
    /**
     * 
     * @return
     */
    public List<Product> listUnexportProduct();

    /**
     * 
     * @param product
     * @param tags
     */
    public void edit(Product product, List<String> tags);
    
    /**
     * 
     * @param product
     * @param type
     */
    public void stick(Product product, ProductType type);
    
    /**
     * 
     * @param product
     * @param type
     */
    public void unStick(Product product, ProductType type);
    
    /**
     * Load the latest product to create new product
     * 
     * @param course
     * @return
     */
    public Product loadLatestProduct(Course course);
    
    /**
     * 
     * @param latestProduct
     * @return
     */
    public Product create(Product latestProduct);
    
    /**
     * 
     * @param productIds
     * @param login
     */
    public void exportInventory(List<Long> productIds, Login login);
    
    /**
     * 
     * @param page
     * @return
     */
    public List<InventoryExportRecord> listExportRecord(Page page);
    
    /**
     * 
     * @return
     */
    public List<Product> listGive();
    
    public List<Product> listExperience();
    
    public List<Product> ifExist(int hours, String name);
    
    public List<Product> ifExist(String name);

    public Product getProduct(int hours);
    
    public Product getProduct(int hours, String name);
    
    public Product getProduct(String name);
    
    /**
     * 
     * @param courseUnit
     * @param courseType
     * @return
     */
    public Product getProduct(CourseUnit courseUnit, CourseType courseType);
    
    public Product getProduct(CourseUnit courseUnit, int hours);
    
    /**
     * 删除课程
     * @param deleted
     */
    public void deletedProduct(boolean deleted,Long productId);
    
}
